/**
 * 
 */
package q9;

/**
 * @author 11611601 何海彬
 * @date Apr 18, 2017 9:06:07 AM
 */
public class Display {
	public static void triangle(int height) {
		for(int i = 0; i < height; i ++) {
			for(int j = 1; j < 2*height; j ++) {
				if(j < height-i || j > height+i) {
					System.out.print(' ');
				} else {
					System.out.print(i + 1);
				}
			}
			System.out.println();
		}
	}
	
	//draw triangle with content
	public static void triangle(int height, char content) {
		for(int i = 0; i < height; i ++) {
			for(int j = 1; j < 2*height; j ++) {
				if(j < height-i || j > height+i) {
					System.out.print(' ');
				} else {
					System.out.print(content);
				}
			}
			System.out.println();
		}
	}
}
